#if !defined(__BLOBDETECTION_H__)
#define __BLOBDETECTION_H__

#include "EdgeDetection.h"
#include "Blob.h"

class Blob;

namespace blobDetection

{

//==================================================
//class BlobDetection
//==================================================
class BlobDetection: public EdgeDetection
{
public:
	static int	blobMaxNumber;
	int	blobNumber;
	Blob *blob;
	bool *gridVisited;
	int	blobWidthMin, blobHeightMin;
	
//--------------------------------------------
// Constructor
//--------------------------------------------
	BlobDetection(int imgWidth, int imgHeight, int bytesPerPixel);

//--------------------------------------------
// setBlobDimensionMin()
//--------------------------------------------
	void setBlobDimensionMin(int w, int h);

//--------------------------------------------
// setNumberBlobMax()
//--------------------------------------------
	void setBlobMaxNumber(int nb);

//--------------------------------------------
// getBlob()
//--------------------------------------------
	Blob getBlob(int n);

//--------------------------------------------
// getBlobNb()
//--------------------------------------------
	int getBlobNb();

//--------------------------------------------
// computeBlobs()
//--------------------------------------------
	void computeBlobs(int *pixels);

//--------------------------------------------
// findBlob()
//--------------------------------------------
	void findBlob(int iBlob, int x, int y);

//--------------------------------------------
// computeEdgeVertex()
//--------------------------------------------
	void computeEdgeVertex(int iBlob, int x, int y);

//--------------------------------------------
// filterBlob()
//--------------------------------------------
	bool acceptBlob(Blob b);

};

};

#endif
